import 'package:json_annotation/json_annotation.dart';
import 'package:pplive/models/icon_model.dart';
import 'anchorLevelInfo.dart';

part 'user.g.dart';

@JsonSerializable()
class User {
  @JsonKey(defaultValue: 0)
  final int uid;
  @JsonKey(defaultValue: 0)
  final int shortId;
  @JsonKey(defaultValue: '')
  final String name;
  @JsonKey(defaultValue: '')
  final String head;
  @JsonKey(defaultValue: '')
  final String headwearUrl;
  @JsonKey(defaultValue: '')
  final String gender;
  final IconModel? richLabel;
  @JsonKey(defaultValue: 0)
  final int richLevel;
  final IconModel? platformLabel;
  @JsonKey(defaultValue: 0)
  final int platformLevel;
  final IconModel? glamourLabel;
  @JsonKey(defaultValue: 0)
  final int glamourLevel;
  @JsonKey(defaultValue: '')
  final String vipLevel;
  @JsonKey(defaultValue: '')
  final String vipImage;
  @JsonKey(defaultValue: [])
  final List<IconModel> listLabel;
  @JsonKey(defaultValue: false)
  final bool isTrueLove;
  @JsonKey(defaultValue: false)
  final bool canUseHide;
  @JsonKey(defaultValue: false)
  final bool isHideUser;
  @JsonKey(defaultValue: false)
  final bool subscribe;
  @JsonKey(defaultValue: false)
  final bool online;
  final AnchorLevelInfo? anchorLevelInfo;
  @JsonKey(defaultValue: false)
  final bool officialChannel;
  @JsonKey(defaultValue: false)
  final bool hideUser;
  @JsonKey(defaultValue: false)
  final bool trueLove;

  const User({
    required this.uid,
    required this.shortId,
    required this.name,
    required this.head,
    required this.headwearUrl,
    required this.gender,
    this.richLabel,
    required this.richLevel,
    this.platformLabel,
    required this.platformLevel,
    this.glamourLabel,
    required this.glamourLevel,
    required this.vipLevel,
    required this.vipImage,
    required this.listLabel,
    required this.isTrueLove,
    required this.canUseHide,
    required this.isHideUser,
    required this.subscribe,
    required this.online,
    this.anchorLevelInfo,
    required this.officialChannel,
    required this.hideUser,
    required this.trueLove,
  });

  factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);

  Map<String, dynamic> toJson() => _$UserToJson(this);
}
